package org.edu.controller;

import java.io.Serializable;
import java.util.List;

import javax.annotation.PostConstruct;

import org.edu.model.Sciency;
import org.edu.service.SciencyServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class SciencyContoller implements Serializable {

	private static final long serialVersionUID = 1L;
	@Autowired
	private transient SciencyServices sciencyServices;
	private Sciency sciency;
	private List<Sciency> listSciencies;
	
	public SciencyContoller(){
		sciency = new Sciency();
	}
	
	@PostConstruct
	public void init(){
		listSciencies = sciencyServices.sciencies();
	}

	public Sciency getSciency() {
		if(sciency == null){
			sciency = new Sciency();
		}
		return sciency;
	}

	public void setSciency(Sciency sciency) {
		this.sciency = sciency;
	}

	public List<Sciency> getListSciencies() {
		return listSciencies;
	}

}
